package com.qfedu.service.impl;

import com.qfedu.dao.OrderMapper;
import com.qfedu.pojo.Order;
import com.qfedu.pojo.OrderCount;
import com.qfedu.service.OrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("orderService")
public class OrderServiceImpl implements OrderService {
    @Resource
    private OrderMapper orderMapper;
    @Override
    public OrderService queryById(Integer id) {
        return (OrderService) this.orderMapper.queryById(id);
    }

    @Override
    public boolean deleteById(Integer id) {
        return this.orderMapper.deleteById(id) > 0;
    }

    @Override
    public List<Order> queryAll() {
        return this.queryAll();
    }

    @Override
    public List<OrderCount> selectOrders() {
        return this.orderMapper.selectOrders();
    }

    @Override
    public List<OrderCount> selectOrdersByUser(Integer uid) {
        return this.orderMapper.selectOrdersByUser(uid);
    }
}
